#ifndef QWSCENTRAL_H
#define QWSCENTRAL_H

#include <QtGui>
#include <QXmlSimpleReader>

#include <QtXmlPatterns/QXmlQuery>
#include <QtXmlPatterns/QXmlSerializer>

#include <iostream>

#include "qwsabstractwidget.h"
#include "../core/radioinfo.h"

class QWSCentral : public QWidget
{
    Q_OBJECT

 public:
    QWSCentral(QWidget *parent = 0);
    void createTableList();
    QStringList getResultStringList(const QString& queryString, const QUrl& documentUrl);
    void parsingRadioStations();
    void addStationToTable();

    ~QWSCentral();

 signals:
	void radioSel(RadioInfo radio);

 protected:
	void resizeEvent(QResizeEvent *event);

 private slots:
	 void radioSelectedEmitIndex(const QModelIndex index);

 private:
    QXmlQuery parser;
    QUrl url;

    QWidget *container;
    QHBoxLayout *containerLayout;

    QTableView *tableView;
    QStandardItemModel *tableModel;
    QList<RadioInfo> radioList;
};

#endif // QWSCENTRAL_H
